#!usr/bin/perl -w

#定义了Include类
package Include;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(Parse Array);
use strict;

sub new()
{
	my $self={};
	bless $self;
	$self->Construct();
	return $self;
}

sub Construct()
{
	my $this=shift;
	$this->{'iArray'}=[];#一个数组的引用
}

sub Array()
{
	my $this=shift;
	return $this->{'iArray'};
}

sub Parse()
{
	my $this=shift;
	my ($ref)=@_;
	while (my ($key,$value)=each(%$ref))
	{
		if ($key eq "item")
		{
			my $name=$value->{'name'};
			if (defined $name)
			{
				$this->Add($name);
			}
		}
	}
}

sub Add()
{
	my $this=shift;
	my ($item)=@_;
	my @array=$this->{'iArray'};
	push @array,$item;
}

1;

